package com.yld.car.market;

import com.yld.car.common.ConstantUtils;
import com.yld.car.common.PortTask;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class FilterBrandActivity extends BaseActivity implements
		OnItemClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.base_list);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);

		this.settingTitle(R.id.title, "选择品牌");

		list = (ListView) findViewById(R.id.list1);
		list.setOnItemClickListener(this);

		new PortTask("0", ConstantUtils.GET_BRAND_URL, list, this,null).execute("");
	}

	private ListView list;

	@Override
	public void onItemClick(AdapterView<?> adapterView, View view,
			int position, long id) {

		String brandName = adapterView.getAdapter().getItem(position)
				.toString();

		Intent intent = new Intent();
		intent.putExtra("brandName", brandName);
		setResult(RESULT_OK, intent);
		finish();
	}
}
